package com.jdk8.demo;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class Java8_Stream_map {
	
	public static void main(String[] args) {
		//平方数(map)
		List<Integer> nums = Arrays.asList(1, 2, 3, 4);
		List<Integer> squareNums = nums.stream().
		map(n -> n * n).
		collect(Collectors.toList());
		
	}

}
